﻿Imports Microsoft.VisualBasic
Imports System.Drawing.Imaging

Public Class Form1
    Dim a As Integer = 1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim num4 As Integer
        Try
            Dim size As Size
            Dim num5 As Integer
LCA_0000:
            Dim num3 As Integer = -2
LCA_0009:
            num5 = 2
            Me.dlgOpen.ShowDialog()
LCA_0018:
            num5 = 3
            Dim original As Bitmap = DirectCast(Image.FromFile(Me.dlgOpen.FileName), Bitmap)
LCA_0031:
            num5 = 4
            size.Height = &H110
LCA_0040:
            num5 = 5
            size.Width = 480
LCA_004F:
            num5 = 6
            Dim bitmap2 As New Bitmap(original, size)
LCA_005A:
            num5 = 7
            Me.imgTheWP.Image = DirectCast(bitmap2.Clone, Image)
LCA_0073:
            num5 = 8
            original.Dispose()
LCA_007C:
            num5 = 9
            bitmap2.Dispose()
LCA_0086:
            num5 = 10
            Dim filename As String = (Environ("tmp") & "\tmpwavep.bmp")
LCA_009B:
            num5 = 11
            Dim str6 As String = (Environ("tmp") & "\tmpmux.bmp")
LCA_00B0:
            num5 = 12
            Dim fileInfo As IO.FileInfo = My.Computer.FileSystem.GetFileInfo(Me.dlgOpen.FileName)
LCA_00D0:
            num5 = 13
            Dim directoryName As String = fileInfo.DirectoryName
LCA_00DD:
            num5 = 14
            Dim name As String = fileInfo.Name
LCA_00EA:
            num5 = 15
            original = DirectCast(Me.imgTheWP.Image.Clone, Bitmap)
LCA_0104:
            num5 = &H10
            bitmap2 = New Bitmap(480, &H110, PixelFormat.Format24bppRgb)
LCA_011D:
            num5 = &H11
            Dim x As Integer = 0
LCA_0124:
            num5 = &H12
            Dim y As Integer = 0
LCA_012B:
            num5 = &H13
            bitmap2.SetPixel(x, y, original.GetPixel(x, y))
LCA_0143:
            num5 = 20
            y += 1
            If (y <= &H10F) Then
                GoTo LCA_012B
            End If
LCA_0156:
            num5 = &H15
            Me.imgTheWP.Image = DirectCast(bitmap2.Clone, Image)
LCA_0170:
            num5 = &H16
            Application.DoEvents()
LCA_0179:
            num5 = &H17
            x += 1
            If (x <= &H1DF) Then
                GoTo LCA_0124
            End If
LCA_018C:
            num5 = &H18
            bitmap2.Save(filename, ImageFormat.Bmp)
LCA_019D:
            num5 = &H19
            If Not IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\converted") Then My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\converted")
            My.Computer.FileSystem.CopyFile(filename, Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\converted\" & CStr(a) & ".bmp")
LCA_01FF:
            num5 = &H1D
            original.Dispose()
LCA_0209:
            num5 = 30
            bitmap2.Dispose()
LCA_0213:
            num5 = &H1F
            Interaction.MsgBox("finish", MsgBoxStyle.Information, "Done....")
            a += 1
            GoTo LCA_030B
LCA_022E:
            num4 = 0
            Select Case (num4 + 1)
                Case 1
                    GoTo LCA_0000
                Case 2
                    GoTo LCA_0009
                Case 3
                    GoTo LCA_0018
                Case 4
                    GoTo LCA_0031
                Case 5
                    GoTo LCA_0040
                Case 6
                    GoTo LCA_004F
                Case 7
                    GoTo LCA_005A
                Case 8
                    GoTo LCA_0073
                Case 9
                    GoTo LCA_007C
                Case 10
                    GoTo LCA_0086
                Case 11
                    GoTo LCA_009B
                Case 12
                    GoTo LCA_00B0
                Case 13
                    GoTo LCA_00D0
                Case 14
                    GoTo LCA_00DD
                Case 15
                    GoTo LCA_00EA
                Case &H10
                    GoTo LCA_0104
                Case &H11
                    GoTo LCA_011D
                Case &H12
                    GoTo LCA_0124
                Case &H13
                    GoTo LCA_012B
                Case 20
                    GoTo LCA_0143
                Case &H15
                    GoTo LCA_0156
                Case &H16
                    GoTo LCA_0170
                Case &H17
                    GoTo LCA_0179
                Case &H18
                    GoTo LCA_018C
                Case &H19
                    GoTo LCA_019D
                Case &H1A
                    GoTo LCA_019D
                Case &H1B
                    GoTo LCA_019D
                Case &H1C
                    GoTo LCA_019D
                Case &H1D
                    GoTo LCA_01FF
                Case 30
                    GoTo LCA_0209
                Case &H1F
                    GoTo LCA_0213
                Case &H20
                    GoTo LCA_030B
                Case Else
                    GoTo LCA_0300
            End Select
LCA_02C0:
            num4 = num5
            Select Case CBool(IIf((num3 > -2), num3, 1))
                Case 0
                    GoTo LCA_0300
                Case 1
                    GoTo LCA_022E
            End Select
        Catch obj1 As Exception
            MsgBox(obj1.Message)
            GoTo LCA_02C0
        End Try
LCA_0300:
        MsgBox(Err.ToString)
LCA_030B:
        If (num4 <> 0) Then
            MsgBox("err")
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox("if you want to convert more than 1 image (what i think^^) then after the conversion of one image do not close the program" & vbCrLf & "cause it counts the converted images and gives the right name.." & vbCrLf & "Remeber: max 30 images at moment!" & vbCrLf & "ABC (Auto Background Changer) by hackerking, converter by hackerking", MsgBoxStyle.Information)
    End Sub
End Class
